// jobs内容显示隐藏
let jobsList = document.getElementById('jobsList');
/**
* 事件注册 = 事件委托
 */
jobsList.addEventListener('click', function(e){
    let target = e.target
    let targetType = target.getAttribute('data-type');
    let targetName = target.tagName.toLowerCase()
    let hasClassName = ''
    if(targetType == 'mark' && targetName == 'div') {
        hasClassName = target.parentNode.parentNode.className
        if(hasClassName){
            target.parentNode.parentNode.className = ''
        }else{
            target.parentNode.parentNode.className = 'show'
        }
    }
})


//表单验证
function checkForm(){
    let name = document.getElementById('name');
    let mobile = document.getElementById('mobile');
    let email = document.getElementById('email');
    let text = document.getElementById('text');
    let code = document.getElementById('code');
    if(!name.value) {
        alert('姓名不能为空！！')
        return false
    }
    if(!mobile.value) {
        alert('手机号不能为空！！')
        return false
    }
    if(!(/^1[34578]\d{9}$/.test(mobile.value))){ 
        alert('手机号格式有误，请重新填写！！') 
        return false  
    }
    //ajax
}